package com.fangyouyun.service;

import com.fangyouyun.Main;
import com.fangyouyun.mapper.UserDao;
import com.fangyouyun.pojo.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("userServiceImpl")
public class UserServiceImpl {

    private static Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private UserDao userDao;

    public List<User> getAll(){
        List<User> userList =  userDao.queryAll();
        return userList;
    }

    public int countUser(){
        return jdbcTemplate.queryForObject("SELECT count(1) from lb_futures_user", Integer.class);
    }

}
